﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Csla.Xaml;

namespace csla4Skeleton.UI.SL.NghiepVu.TinhGiaThanh.DM_PhuongPhapTGT
{
    public class DM_PhuongPhapTGT_ViewModel : ViewModel<Accounting.Library.DM_PhuongPhapTGT>
    {
        public event EventHandler Saved;
        public event EventHandler Canceled;

        public DM_PhuongPhapTGT_ViewModel(string mode)
        {
            if (mode.Equals(BusinessConfiguration.Configuration.ChildWindow))
            {
                this.BeginRefresh("NewDM_PhuongPhapTGT");
            }
           
        }
        public void GetDM_PhuongPhapTGT(object sender, ExecuteEventArgs e)
        {
            if (e.MethodParameter != null)
            {
                //cast parameter
                string parameter = e.MethodParameter.ToString();
                this.BeginRefresh("GetDM_PhuongPhapTGT", int.Parse(parameter));
            }
        }

        public void NewDM_PhuongPhapTGT()
        {
           
            this.BeginRefresh("NewDM_PhuongPhapTGT");
            
        }

        protected override void OnSaved()
        {
            base.OnSaved();
            Saved(this, EventArgs.Empty);
        }

        protected override void DoCancel()
        {
            base.DoCancel();
            Canceled(this, EventArgs.Empty);
        }
    }
}








